﻿// =====================================================
// Copyright (C) 2016-2019 Fanjia
// All rights reserved
// 机器名称: PC-LIWEI
// 创建时间: 2019/1/23 19:19:19
// 创 建 人: 李伟
// ======================================================

using System;
using System.Globalization;
using Newtonsoft.Json;
using Newtonsoft.Json.Converters;

namespace WindowsFormsApplication1.Model
{
    public partial class HotelLowerPriceRequest
    {
        [JsonProperty("SearchTypeEntity")]
        public SearchTypeEntity SearchTypeEntity { get; set; }

        [JsonProperty("PublicSearchParameter")]
        public PublicSearchParameter PublicSearchParameter { get; set; }

        [JsonProperty("FacilityEntity")]
        public FacilityEntity FacilityEntity { get; set; }

        [JsonProperty("MapSearchEntity")]
        public MapSearchEntity MapSearchEntity { get; set; }

        [JsonProperty("OrderBy")]
        public OrderBy OrderBy { get; set; }
    }

    public partial class FacilityEntity
    {
        [JsonProperty("ChildrenAgeList")]
        public long[] ChildrenAgeList { get; set; }
    }

    public partial class MapSearchEntity
    {
        [JsonProperty("DotX")]
        public double DotX { get; set; }

        [JsonProperty("DotY")]
        public double DotY { get; set; }

        [JsonProperty("Radius")]
        public double Radius { get; set; }
    }

    public partial class OrderBy
    {
        [JsonProperty("OrderName")]
        public string OrderName { get; set; }

        [JsonProperty("OrderType")]
        public string OrderType { get; set; }
    }

    public partial class PublicSearchParameter
    {
        [JsonProperty("City")]
        public long City { get; set; }

        [JsonProperty("CheckInDate")]
        public DateTimeOffset CheckInDate { get; set; }

        [JsonProperty("CheckOutDate")]
        public DateTimeOffset CheckOutDate { get; set; }

        [JsonProperty("HotelList")]
        public string HotelList { get; set; }

        [JsonProperty("FilterRoomByPerson")]
        public string FilterRoomByPerson { get; set; }

        [JsonProperty("OnlyPPPrice")]
        public bool OnlyPpPrice { get; set; }

        [JsonProperty("OnlyFGPrice")]
        public bool OnlyFgPrice { get; set; }

        [JsonProperty("IsJustifyConfirm")]
        public string IsJustifyConfirm { get; set; }

        [JsonProperty("PlotType")]
        public string PlotType { get; set; }
    }

    public partial class SearchTypeEntity
    {
        [JsonProperty("SearchType")]
        public string SearchType { get; set; }

        [JsonProperty("HotelCount")]
        public long HotelCount { get; set; }

        [JsonProperty("PageIndex")]
        public long PageIndex { get; set; }
    }

    public partial class HotelLowerPriceRequest
    {
        public static HotelLowerPriceRequest FromJson(string json) => JsonConvert.DeserializeObject<HotelLowerPriceRequest>(json, PoiModel.Converter.Settings);
    }

    public static class Serialize
    {
        public static string ToJson(this HotelLowerPriceRequest self) => JsonConvert.SerializeObject(self, PoiModel.Converter.Settings);
    }

    internal static class Converter
    {
        public static readonly JsonSerializerSettings Settings = new JsonSerializerSettings
        {
            MetadataPropertyHandling = MetadataPropertyHandling.Ignore,
            DateParseHandling = DateParseHandling.None,
            Converters =
            {
                new IsoDateTimeConverter { DateTimeStyles = DateTimeStyles.AssumeUniversal }
            },
        };
    }
}
